package com.atguigu.springcloud.controller;

import com.atguigu.springcloud.entities.CommonResult;
import com.atguigu.springcloud.service.AccountService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @PROJECT_NAME: cloud2020
 * @DESCRIPTION:
 * @Author: csc
 * @DATE: 2023/4/6 14:54
 */
@RestController
public class AccountController {

    @Autowired
    private AccountService accountService;

    @GetMapping("/account/decrease")
    public CommonResult decrease(@Param("userId") Long userId,@Param("money") BigDecimal money){
         accountService.decrease(userId,money);
        return new CommonResult(200,"余额");
    }

}
